﻿///////////////////////////////////////////////////////////////////////////
/// File: <FileName>
/// Description: 
///    -  本文件是由代码生成工具自动生成的，如非必要，不要修改，若有新增内容，新建一个partial类进行新增。
///    -  此文件是根据facade模式和接口隔离原则创建的。各个子业务之间的关联在这里建立。
///    <Description>
/// Copyright© <DateTime.Now.Year> <Copyright>
/// History:
///     <DateTime.Now>    My.GenCode    Original Version
///////////////////////////////////////////////////////////////////////////
 
using System;
using System.Collections.Generic;
using System.Security.Permissions;
using MAF.Common;
using MAF.Common.Security;
using MAF.Security.Authorization;
using <NameSpace>.Domain.Entities;
using <NameSpace>.Domain.Interfaces;
using <NameSpace>.Business.Persistence;
using <NameSpace>.Business.Security;

namespace <NameSpace>.Business.Service
{
    public partial class <ClassName> : <InterfaceNames>
    {
        [loop<DeclareDao>]private <Interface> _<DaoClassName> = null;
        [/loop<DeclareDao>]
        [loop<DeclareSafe>]private <Interface> _<SafeClassName> = null;
        [/loop<DeclareSafe>]
        
        #region 构造函数
        public <ClassName>(string daoConfFileName)
        {
            [loop<InitDao>]_<DaoClassName> = new <DaoClassName>(daoConfFileName);
            [/loop<InitDao>]
            [loop<InitSafe>]_<SafeClassName> = new <SafeClassName>(_<DaoClassName>);
            [/loop<InitSafe>]
        }
        #endregion
        
        [loop<CodeBlock>]
        #region <InterfaceName>成员
        ///<summary>
        /// <CreateMethodName>
        ///</summary>
        public <CreateMethodSign>
        {
            info.DateCreated = DateTime.Now;
            return _<SafeClassName>.<CreateMethodName>(info);
        }
        
        ///<summary>
        /// <UpdateMethodName>
        ///</summary>
        public <UpdateMethodSign>
        {
            info.DateModified = DateTime.Now;
            return _<SafeClassName>.<UpdateMethodName>(info);
        }
        
        ///<summary>
        /// <DeleteMethodName>
        ///</summary>
        public <DeleteMethodSign>
        {
            return _<SafeClassName>.<DeleteMethodName>(info);
        }
        
        ///<summary>
        /// <ReadDetailMethodName>
        ///</summary>
        public <ReadDetailMethodSign>
        {
            return _<SafeClassName>.<ReadDetailMethodName>(info);
        }
        
        ///<summary>
        /// <ReadListMethodName>
        ///</summary>
        public <ReadListMethodSign>
        {
            PageInfo page = new PageInfo( pageSize,currentPage );
            page.RecordCount = _<SafeClassName>.<ReadCountMethodName>(info);
            return _<SafeClassName>.<ReadListMethodName>(info,page.PageSize,page.CurrentPage);
        }
        
        ///<summary>
        /// <ReadCountMethodName>
        ///</summary>
        public <ReadCountMethodSign>
        {
            return _<SafeClassName>.<ReadCountMethodName>( info );
        }
        #endregion
        [/loop<CodeBlock>]
    }
}